# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=libzim
pkgver=6.1.8
pkgrel=0
pkgdesc="Reference implementation of the ZIM file format"
url="https://openzim.org/"
arch="all !mips !mips64" # tests crash
license="GPL-2.0-or-later"
makedepends="
	icu-dev
	libexecinfo-dev
	meson
	xapian-core-dev
	xz-dev
	zlib-dev
	zstd-dev
	"
checkdepends="
	cython
	gtest-dev
	python3-dev
	"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/openzim/libzim/archive/$pkgver.tar.gz
	cython-not-cython3.patch
	"

build() {
	LDFLAGS="$LDFLAGS -lexecinfo"
	abuild-meson . output
	ninja -C output
}

check() {
	ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install

	install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

sha512sums="f51b23b7bfda265a019bcbcaca9f27830ad74414dfd6b53d121066b097c1a8bc271783cc9c5954f861de23f3e2d74e161d5e21406975cb7f06452587614b9f80  libzim-6.1.8.tar.gz
e2d2e749a6764c0002c123b988b24494ff76547542f17753d04b48f90785e4a92a5bb96a1840e0ebd661a727ecc1eb050679ae0ba1b3fda99410d09ac8e28f27  cython-not-cython3.patch"
